home *** CD-ROM | disk | FTP | other *** search
- Path: risky.ecs.umass.edu!usenet
- From: jvinson@cheux.ecs.umass.edu (Jack Vinson)
- Newsgroups: comp.lang.c++
- Subject: passing references to containers?
- Date: 12 Mar 1996 18:36:47 -0500
- Organization: University of Massachusetts
- Message-ID: <wozq9lc29c.fsf@cheux.ecs.umass.edu>
- NNTP-Posting-Host: cheux.ecs.umass.edu
- X-Newsreader: September Gnus v0.51/Emacs 19.30
-
-
- Is it legal to pass references to template containers of classes? I think
- it is, but my compiler is giving me error messages.
-
- I have a basic array template that does bound-checking in the [] operator.
- I want to pass these arrays around by reference to reduce the amount of
- creating and destroying going on.
-
- However, in SOME cases, the compiler complains when I try to access
- elements of the given array (this is MSVC 2.0):
-
- error C2676: binary '[' : 'class array<class stream_frame>' does not
- define this operator or a conversion to a type acceptable to the
- predefined operator
-
-
- I've also just noticed that for two files in which this happens, if I add
- an #include directive one of the files no longer has the error, while the
- other still has the problems.
-
-
- Thanks for any clues.
-
- --
- Jack Vinson The Purple Puddle Eater and Captain Jack
- jvinson@cheux.ecs.umass.edu <http://www.cis.upenn.edu/~vinson/home.html>
- Sunderland, MA
- "Skin ain't got no tailored pockets." - Eat _Sell_Me_a_God_
-